package com._5704.website.mapper;

import com._5704.website.entity.Activity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author Yiyoung
 * @since 2021-07-25
 */
@Mapper
public interface ActivityMapper extends BaseMapper<Activity> {

    List<Activity> getPublicActivities(@Param("page") int page, @Param("num") int num);

    List<Activity> getPublicActivitiesByType(@Param("page") int page, @Param("num") int num, @Param("type") int type);

    int getAllNum();

    int getAllNumByType(int type);

    List<Activity> getActivityByName(@Param("name")String name, @Param("page")int page, @Param("num")int num);

    int getSearchNum(String name);

    void updatePic(@Param("pic")String dataBaseFileName,@Param("id") Integer id);

    List<Activity> getAllActivities(@Param("page") int page, @Param("num") int num);

    List<Activity> getAllActivitiesByType(@Param("page") int page, @Param("num") int num, @Param("type") int type);

    int getPublicNum();

    int getPublicNumByType(int type);
}
